<template>
  <div class="list-container">
    <van-contact-card
      type="edit"
      v-for="item in tableList"
      :key="item._id"
      :name="item.name"
      :tel="item.mobile"
      @click="onEdit"
    />
  </div>
</template>

<script>
import { Toast } from 'vant'
import { getUser } from '@/api/user'
export default {
  name: 'ListIndex',
  components: {},
  props: {},
  data () {
    return {
      tableList: []
    }
  },
  computed: {},
  watch: {},
  created () {},
  mounted () {
    this.getUserList()
  },
  methods: {
    onEdit () {
      Toast('编辑')
    },
    getUserList () {
      getUser({
        role: 'student'
      }).then(res => {
        this.tableList = res.data.data
      }).catch(err => {
        console.log(err)
      })
    }
  }
}
</script>

<style scoped lang="">

</style>
